package _07_singleton_pattern.v3_0_Multiple;

/**
 * @Description: 存在上限的多例模式
 * @Auther: 2019/6/11 14:52 by zhang.jy
 */
public class Minister {
     public static void main(String[] args) {
             //定义5个大臣
             int ministerNum =5;                
             for(int i=0;i<ministerNum;i++){
                     Emperor emperor = Emperor.getInstance();
                     System.out.print("第"+(i+1)+"个大臣参拜的是：");
                     emperor.say();
             }
     }
}